/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package OrchestrationLanguage.impl;

import OrchestrationLanguage.OrchestrationLanguagePackage;
import OrchestrationLanguage.Variable;
import OrchestrationLanguage.Variable_Assignment;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Variable Assignment</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link OrchestrationLanguage.impl.Variable_AssignmentImpl#getAssign <em>Assign</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class Variable_AssignmentImpl extends CommandImpl implements Variable_Assignment {
	/**
	 * The cached value of the '{@link #getAssign() <em>Assign</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAssign()
	 * @generated
	 * @ordered
	 */
	protected Variable assign;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected Variable_AssignmentImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return OrchestrationLanguagePackage.Literals.VARIABLE_ASSIGNMENT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Variable getAssign() {
		if (assign != null && assign.eIsProxy()) {
			InternalEObject oldAssign = (InternalEObject)assign;
			assign = (Variable)eResolveProxy(oldAssign);
			if (assign != oldAssign) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OrchestrationLanguagePackage.VARIABLE_ASSIGNMENT__ASSIGN, oldAssign, assign));
			}
		}
		return assign;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Variable basicGetAssign() {
		return assign;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAssign(Variable newAssign) {
		Variable oldAssign = assign;
		assign = newAssign;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OrchestrationLanguagePackage.VARIABLE_ASSIGNMENT__ASSIGN, oldAssign, assign));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case OrchestrationLanguagePackage.VARIABLE_ASSIGNMENT__ASSIGN:
				if (resolve) return getAssign();
				return basicGetAssign();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case OrchestrationLanguagePackage.VARIABLE_ASSIGNMENT__ASSIGN:
				setAssign((Variable)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case OrchestrationLanguagePackage.VARIABLE_ASSIGNMENT__ASSIGN:
				setAssign((Variable)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case OrchestrationLanguagePackage.VARIABLE_ASSIGNMENT__ASSIGN:
				return assign != null;
		}
		return super.eIsSet(featureID);
	}

} //Variable_AssignmentImpl
